﻿<%@ Page Title="<%$Resources:Language,CmsProductsCommentsTitle %>" Language="C#"
    MasterPageFile="~/cms.master" AutoEventWireup="true" CodeFile="ProductsComments.aspx.cs"
    Inherits="cms_ProductsComments" %>

<%@ Register Src="../controls/ctrlShowInfo.ascx" TagName="ctrlShowInfo" TagPrefix="uc1" %>
<%@ Register Src="~/controls/ctrlWait.ascx" TagName="ctrlWait" TagPrefix="ctrl" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="Server">

    <script language="javascript" type="text/javascript" src="../Javascript/Common.js"></script>

    <asp:UpdatePanel ID="up" runat="server">
        <ContentTemplate>
            <h2>
                <%=Resources.Language.CommentsAdministration %>
                <asp:Label ID="lProduct" runat="server"></asp:Label></h2>
        </ContentTemplate>
    </asp:UpdatePanel>
    <ctrl:ctrlWait ID="ctrlWait" runat="server" />
    <asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <uc1:ctrlShowInfo ID="ctrlShowInfo" runat="server" />
            <asp:Panel ID="pnlProducts" runat="server">
                <asp:GridView ID="gvProducts" runat="server" AutoGenerateColumns="false" CssClass="cmsTables" AllowPaging="true" PageSize="50"  OnPageIndexChanging="gvProducts_PageIndexChanging">
                    <Columns>
                        <asp:BoundField DataField="ProductID" HeaderText="ID" />
                        <asp:TemplateField HeaderText="<%$Resources:Language,Name %>">
                            <ItemTemplate>
                                <asp:LinkButton ID="lbProceed" runat="server" Text='<%#Eval("ProductName")%>' OnCommand="ShowComments"
                                    CommandArgument='<%#Eval("ProductID")%>'></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Count" HeaderText="<%$Resources:Language,Amount %>" />
                        <asp:BoundField DataField="Hidden" HeaderText="<%$Resources:Language,Hidden %>" />
                        <asp:BoundField DataField="Accepted" HeaderText="<%$Resources:Language,Accepted %>" />
                        <asp:BoundField DataField="ToAcceptation" HeaderText="<%$Resources:Language,ToAcceptation %>" />
                    </Columns>
                </asp:GridView>
            </asp:Panel>
            <asp:Panel ID="pnlComments" runat="server" Visible="false">
                <div>
                    <asp:Button ID="btnBackTop" runat="server" Text="<%$ Resources:Language,Back %>"
                        OnCommand="CommentsCommand" CommandName="Back" />
                    <asp:Button ID="btnSaveTop" runat="server" Text="<%$Resources:Language,Save%>" OnCommand="CommentsCommand"
                        CommandName="Save" />
                    <asp:Button ID="btnCancelTop" runat="server" Text="<%$REsources:Language,Cancel%>"
                        OnCommand="CommentsCommand" CommandName="Cancel" />
                </div>
                <div class="vSeparate">
                    <asp:GridView ID="gvComments" runat="server" AutoGenerateColumns="false" CssClass="cmsTables"
                        AllowPaging="true" PageSize="50" OnPageIndexChanging="gvComments_PageIndexChanging">
                        <Columns>
                            <asp:BoundField DataField="IDcomment" HeaderText="ID" />
                            <asp:BoundField DataField="Author" HeaderText="<%$ Resources:Language,Author %>" />
                            <asp:BoundField DataField="Content" HeaderText="<%$Resources:Language,Comment %>" />
                            <asp:TemplateField HeaderText="<%$Resources:Language,Accept %>">
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbAccept" runat="server" Checked='<%#Eval("Accepted")%>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$Resources:Language,Hide %>">
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbHide" runat="server" Checked='<%#Eval("Hidden") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </div>
                <div class="vSeparate">
                    <asp:Button ID="btnBackBottom" runat="server" Text="<%$ Resources:Language,Back %>"
                        OnCommand="CommentsCommand" CommandName="Back" />
                    <asp:Button ID="btnSaveBottom" runat="server" Text="<%$Resources:Language,Save%>"
                        OnCommand="CommentsCommand" CommandName="Save" OnClientClick="ScrollTop();" />
                    <asp:Button ID="btnCancelBottom" runat="server" Text="<%$REsources:Language,Cancel%>"
                        OnCommand="CommentsCommand" CommandName="Cancel" OnClientClick="ScrollTop();" />
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
